package com.authine.cloudpivot.ext.enums;

/**
 * 订单商品状态
 * 适用范围【t_order_goods_returns.origin_status】
 * @author Adam
 */
@Deprecated
public enum OrderGoodsStatusV1Enum {
    /**
     * 各节点状态修改(正向流程)
     * 1、客户下单->待付款
     * 2、客户付款->待出库
     * 3、供应商接单->待发货
     * 4、供应商发货->待收货
     */
    ALL(0, "全部"),
    NEW(1, "新建"),
    SUBMIT(2, "待付款"),
    PAYED(3, "待出库"),//待发货
    PACKAGING(4, "待发货"),//出库中
    DELIVERED(5, "待收货"),//已发货
    TO_RETURN(6, "待退货"),
    RETURNING(7, "退货中"),
    REFUNDING(8, "退款中"),
    RETIRED(9, "已退货"),
    MIDDLEMAN(10, "客服已介入"),//未用
    DONE(11, "已完成"),
    CLOSED(12, "已关闭"),
    REFUND_APPLICATION(13, "退款申请中"),
    RETURNED(14, "已退款"),
    TO_REFUND(15, "待退款");//未用

    public Integer id;
    public String text;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    OrderGoodsStatusV1Enum(Integer id, String text) {

        this.id = id;
        this.text = text;
    }

    public static OrderGoodsStatusV1Enum get(Integer code) {

        for (OrderGoodsStatusV1Enum c : OrderGoodsStatusV1Enum.values()) {
            if (c.id.toString().equals(code.toString())) {
                return c;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return text;
    }
}
